<?php

class Back_Model_Mapper_Competitions extends Jnd_Model_Mapper_Abstract
{

    protected $_dict = array(
            "id" => "id_competitions",
            "nom" => "nom",
            "enfantDe" => "enfant_de",
            "niveau" => "niveau",
            "url" => "url",
    );

    public function competitionsParNiveau($enfantDe) {
        $table = $this->_getTable();
        $select = new Zend_Db_Table_Select($table);
        $select->where($this->getDict("enfantDe") . "=?", $enfantDe, Zend_Db::INT_TYPE);
        $select->order($this->getDict("niveau") . " ASC");
        
        $stmt = $select->query();
        $resultats = $stmt->fetchAll();
        
        return $this->unmapArray($resultats);
    }
    
    
}

